package org.bud.data.bit.check;

import org.bud.util.bit.Strings;
import org.bud.util.constant.Symbol;

/**
 * @author shaun
 * @date 2024/7/21
 * @instruction
 */
public class KeysCheck implements CheckData{
    private String keys;

    public KeysCheck(String keys){
        this.keys = keys;
    }

    @Override
    public Boolean check(Object data, String key) throws Exception {
        if(Strings.isEmpty(keys)){
            return false;
        }
        String[] kies = keys.split(Symbol.COMMA);
        for(String kie : kies){
            if(key.equals(kie)){
                return true;
            }
        }
        return false;
    }
}
